// classing and subclassing using ExtJS library

Ext.namespace("myapp.widget");

function BaseClass() {
    this.id = 1;
}

var DerivedClass_1 = Ext.extend(BaseClass, {
   id: 2,
   getId: function() {
      return this.id;
   }
});

otherDerived = Ext.extend(Ext.tree.Panel, {
   id: 123,
   name: "john",

   getId: function() {
      return this.id;
   },

   getName: function() {
      return this.name;
   },

   otherMethod: function() {
      this.closure = function() {
      }
   },

   refresh: Ext.emptyFn
});



myapp.widget.Cart = function(myConfig) {
   this.config = myConfig;
}

Ext.extend(myapp.widget.Cart, Ext.Panel, {
   fieldWidth: 150,

   init: function() {
      this.getConfig = function() {
         return this.config;
      }
   },

   refresh: Ext.emptyFn
});


Ext.extend(myapp.widget.FunCart, myapp.widget.Cart);

myapp.widget.FunCart.prototype.refresh = function() {
   this.render();
}

Ext.extend(myapp.widget.SimpleCart, myapp.widget.Cart, {
   newField: new Somewidget(),

   init: function() {
     yadayadayada();
   }
});


